package bg.consulting.labo;

import java.io.IOException;

import javax.media.CaptureDeviceInfo;
import javax.media.CaptureDeviceManager;
import javax.media.Manager;
import javax.media.MediaLocator;
import javax.media.NoDataSourceException;
import javax.media.protocol.DataSource;

public class Microphone implements IDataSourceProvider {

	private DataSource dataSource;
	


	public Microphone() {
		try {
			CaptureDeviceInfo cdi = CaptureDeviceManager.getDevice("DirectSoundCapture");
			MediaLocator mediaLocatorSource = cdi.getLocator();
			this.dataSource = Manager.createDataSource(mediaLocatorSource);
		} catch (Exception e) {
			e.printStackTrace();
		} 
	}

	public DataSource getDataSource() {
		return dataSource;
	}
}
